package com.gqj.elec.service.impl;

import java.util.List;
import com.gqj.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gqj.elec.mapper.ElecMaterialCheckdetailsMapper;
import com.gqj.elec.domain.ElecMaterialCheckdetails;
import com.gqj.elec.service.IElecMaterialCheckdetailsService;

/**
 * 资产盘点子Service业务层处理
 * 
 * @author lxq
 * @date 2023-12-17
 */
@Service
public class ElecMaterialCheckdetailsServiceImpl implements IElecMaterialCheckdetailsService 
{
    @Autowired
    private ElecMaterialCheckdetailsMapper elecMaterialCheckdetailsMapper;

    /**
     * 查询资产盘点子
     * 
     * @param checkDetailId 资产盘点子主键
     * @return 资产盘点子
     */
    @Override
    public ElecMaterialCheckdetails selectElecMaterialCheckdetailsByCheckDetailId(Long checkDetailId)
    {
        return elecMaterialCheckdetailsMapper.selectElecMaterialCheckdetailsByCheckDetailId(checkDetailId);
    }

    /**
     * 查询资产盘点子列表
     * 
     * @param elecMaterialCheckdetails 资产盘点子
     * @return 资产盘点子
     */
    @Override
    public List<ElecMaterialCheckdetails> selectElecMaterialCheckdetailsList(ElecMaterialCheckdetails elecMaterialCheckdetails)
    {
        return elecMaterialCheckdetailsMapper.selectElecMaterialCheckdetailsList(elecMaterialCheckdetails);
    }

    /**
     * 新增资产盘点子
     * 
     * @param elecMaterialCheckdetails 资产盘点子
     * @return 结果
     */
    @Override
    public int insertElecMaterialCheckdetails(ElecMaterialCheckdetails elecMaterialCheckdetails)
    {
        elecMaterialCheckdetails.setCreateTime(DateUtils.getNowDate());
        return elecMaterialCheckdetailsMapper.insertElecMaterialCheckdetails(elecMaterialCheckdetails);
    }

    /**
     * 修改资产盘点子
     * 
     * @param elecMaterialCheckdetails 资产盘点子
     * @return 结果
     */
    @Override
    public int updateElecMaterialCheckdetails(ElecMaterialCheckdetails elecMaterialCheckdetails)
    {
        elecMaterialCheckdetails.setUpdateTime(DateUtils.getNowDate());
        return elecMaterialCheckdetailsMapper.updateElecMaterialCheckdetails(elecMaterialCheckdetails);
    }

    /**
     * 批量删除资产盘点子
     * 
     * @param checkDetailIds 需要删除的资产盘点子主键
     * @return 结果
     */
    @Override
    public int deleteElecMaterialCheckdetailsByCheckDetailIds(Long[] checkDetailIds)
    {
        return elecMaterialCheckdetailsMapper.deleteElecMaterialCheckdetailsByCheckDetailIds(checkDetailIds);
    }

    /**
     * 删除资产盘点子信息
     * 
     * @param checkDetailId 资产盘点子主键
     * @return 结果
     */
    @Override
    public int deleteElecMaterialCheckdetailsByCheckDetailId(Long checkDetailId)
    {
        return elecMaterialCheckdetailsMapper.deleteElecMaterialCheckdetailsByCheckDetailId(checkDetailId);
    }
}
